Sharepoint 2013: Branding and User Interface Design by Randy Drisgill & John Ross & Paul Stubbs
Author:Randy Drisgill & John Ross & Paul Stubbs
Language: eng
Format: epub
Publisher: Wiley Publishing
Published: 2013-12-14T05:00:00+00:00
<body>
<form>
<div class="mainbody">
Hello World
</div>
<div class="footer">
</div>
</form>
</body>
</html>
WARNING
Although not every content placeholder in a master page needs to have a corresponding content control applied in a content page, the opposite is not true. Every content control defined in the content page must have a matching content placeholder in the applied master page; otherwise, an error occurs. In traditional ASP.NET applications this is easy to manage because you are in complete control over how master pages and content pages are set up. Because SharePoint is a dynamic environment with many different site templates, from blogs to wikis and everything in between, it is not uncommon to have all kinds of pages that use content placeholders in unexpected ways or not at all.
User Controls and Server Controls
Another important concept related to master pages is how controls are used to take complex code functionality and reduce it down to a few lines of code. Developers use controls to bundle HTML, existing ASP.NET server controls, and custom functionality into reusable components that can be added to master pages and content pages. User controls have a file extension of .ascx and perform more simple tasks than server controls. Server controls are coded and compiled into DLLs to be loaded on the web server. These controls enable master pages to provide large amounts of custom functionality while containing a relatively small amount of code for maintainability.
To use a control, you must first register it at the top of a content page or master page. This assigns a TagPrefix and a TagName, both of which are used to refer to the control in the page, as well as an src that points to the .ASCX control on the web server, or both a Namespace and an Assembly to point to a compiled DLL. Imagine that you had some search functionality prebuilt as a custom user control named searchbox.ascx. To include this functionality on a master page or content page, you would first register the control near the top of the page, below the language declaration, as shown here:
<%@ Master language="C#"%>
<%@ Register TagPrefix="Custom" TagName="Search" src="searchbox.ascx" %>
To actually use the registered control in the master page, you use a combination of the TagPrefix and the TagName. The following example shows the control added to the page inside of a <div> tag:
<div id="header">
<Custom:Search ID="mySearchControl" runat="server" />
</div>
When the page is loaded in a browser, whatever content the control is programmed to display will be added to the page inside of the <div> tags. Also, if the control was set up to receive custom properties, they could be applied when the control is added to the page. For example, if the search control has a property named ButtonImage to set the search button image, it could be added like this:
<Custom:Search ID="mySearchControl" ButtonImage="go.png" runat="server" />
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(7489)
Supercharging Productivity with Trello by Brittany Joiner(6757)
Mastering Tableau 2023 - Fourth Edition by Marleen Meier(6510)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6432)
Inkscape by Example by István Szép(6373)
Visualize Complex Processes with Microsoft Visio by David J Parker & Šenaj Lelić(6063)
Build Stunning Real-time VFX with Unreal Engine 5 by Hrishikesh Andurlekar(5075)
Design Made Easy with Inkscape by Christopher Rogers(4681)
Customizing Microsoft Teams by Gopi Kondameda(4221)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3951)
Business Intelligence Career Master Plan by Eduardo Chavez & Danny Moncada(3857)
Extending Microsoft Power Apps with Power Apps Component Framework by Danish Naglekar(3808)
Salesforce Platform Enterprise Architecture - Fourth Edition by Andrew Fawcett(3688)
Pandas Cookbook by Theodore Petrou(3668)
The Tableau Workshop by Sumit Gupta Sylvester Pinto Shweta Sankhe-Savale JC Gillet and Kenneth Michael Cherven(3471)
TCP IP by Todd Lammle(3002)
Exploring Microsoft Excel's Hidden Treasures by David Ringstrom(2940)
Drawing Shortcuts: Developing Quick Drawing Skills Using Today's Technology by Leggitt Jim(2933)
Applied Predictive Modeling by Max Kuhn & Kjell Johnson(2898)
